<!DOCTYPE html>
<html lang="zh-CN">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>在线咨询与支持</title>
    <style>
        body {
            font-family: 'Arial', sans-serif;
            background-color: #eaf7e4; /* 浅绿色背景 */
            color: #333; /* 深灰色文字 */
            margin: 0;
            padding: 0;
        }

        header {
            background-color: #4caf50; /* 深绿色头部背景 */
            color: #fff; /* 白色文字 */
            text-align: center;
            padding: 1em;
        }

        section {
            margin: 20px;
        }

        .chat-container {
            background-color: #dff0d8; /* 淡绿色聊天容器背景 */
            padding: 20px;
            border-radius: 10px;
            min-height: 300px;
        }

        .chat-messages {
            overflow-y: scroll;
            max-height: 200px;
            border: 1px solid #ccc;
            border-radius: 5px;
            padding: 10px;
        }

        .user-input {
            margin-top: 10px;
        }

        footer {
            background-color: #4caf50; /* 深绿色底部背景 */
            color: #fff; /* 白色文字 */
            text-align: center;
            padding: 1em;
            position: fixed;
            bottom: 0;
            width: 100%;
        }
    </style>
</head>

<body>
    <header>
        <h1>在线咨询与支持</h1>
    </header>

    <section>
        <div class="chat-container">
            <div class="chat-messages" id="chatMessages">
                <!-- 聊天消息将显示在这里 -->
            </div>
            <div class="user-input">
                <input type="text" id="messageInput" placeholder="输入您的问题">
                <button onclick="sendMessage()">发送</button>
            </div>
        </div>
    </section>

  

    <script>
        function sendMessage() {
            var messageInput = document.getElementById("messageInput");
            var chatMessages = document.getElementById("chatMessages");

            if (messageInput.value.trim() !== "") {
                var userMessage = document.createElement("div");
                userMessage.innerHTML = "<strong>您：</strong> " + messageInput.value;
                chatMessages.appendChild(userMessage);
                messageInput.value = "";

                // 模拟维权专家或客服的回复（这里仅作示例）
                setTimeout(function () {
                    var expertMessage = document.createElement("div");
                    expertMessage.innerHTML = "<strong>维权专家：</strong> 感谢您的咨询，您可以尝试...";
                    chatMessages.appendChild(expertMessage);
                }, 500);
            }
        }
  
    </script>
</body>

</html>